package service

import (
	"kms-backend/controllers/service"

	"github.com/gin-gonic/gin"
)

// 新增
func create(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/create", service.Create)
}

// 更新
func update(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/update", service.Update)
}

func detail(serviceGroup *gin.RouterGroup) {
	serviceGroup.GET("/detail", service.Detail)
}

func list(serviceGroup *gin.RouterGroup) {
	serviceGroup.GET("/list", service.List)
}

func delete(serviceGroup *gin.RouterGroup) {
	serviceGroup.POST("/delete", service.Delete)
}

func RegisterSubRouter(g *gin.RouterGroup) {
	// 配置路由策略
	serviceGroup := g.Group("/service")
	create(serviceGroup)
	update(serviceGroup)
	detail(serviceGroup)
	list(serviceGroup)
	delete(serviceGroup)

}
